<?php

/**
 * This is the model class for table "sys_ewallet_log".
 *
 * The followings are the available columns in table 'sys_ewallet_log':
 * @property string $ewallet_log_id
 * @property string $ewallet_log_network_id
 * @property string $ewallet_log_type
 * @property string $ewallet_log_value
 * @property string $ewallet_log_status
 * @property string $ewallet_log_datetime
 * @property string $ewallet_log_note
 */
class sys_ewallet_log extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return sys_ewallet_log the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'sys_ewallet_log';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('ewallet_log_network_id', 'length', 'max'=>20),
			array('ewallet_log_type', 'length', 'max'=>8),
			array('ewallet_log_value', 'length', 'max'=>10),
			array('ewallet_log_status', 'length', 'max'=>6),
			array('ewallet_log_datetime, ewallet_log_note', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('ewallet_log_id, ewallet_log_network_id, ewallet_log_type, ewallet_log_value, ewallet_log_status, ewallet_log_datetime, ewallet_log_note', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'ewallet_log_id' => 'Ewallet Log',
			'ewallet_log_network_id' => 'Ewallet Log Network',
			'ewallet_log_type' => 'Ewallet Log Type',
			'ewallet_log_value' => 'Ewallet Log Value',
			'ewallet_log_status' => 'Ewallet Log Status',
			'ewallet_log_datetime' => 'Ewallet Log Datetime',
			'ewallet_log_note' => 'Ewallet Log Note',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('ewallet_log_id',$this->ewallet_log_id,true);
		$criteria->compare('ewallet_log_network_id',$this->ewallet_log_network_id,true);
		$criteria->compare('ewallet_log_type',$this->ewallet_log_type,true);
		$criteria->compare('ewallet_log_value',$this->ewallet_log_value,true);
		$criteria->compare('ewallet_log_status',$this->ewallet_log_status,true);
		$criteria->compare('ewallet_log_datetime',$this->ewallet_log_datetime,true);
		$criteria->compare('ewallet_log_note',$this->ewallet_log_note,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}